package com.java2001.service;


import com.java2001.mapper.BookMapper;
import com.java2001.pojo.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    BookMapper bookMapper;

    @Override
    public int insertBook(Book book) {
        return bookMapper.insertBook(book);
    }

    @Override
    public int deleteBookById(String isbn) {
        return bookMapper.deleteBookById(isbn);
    }

    @Override
    public int updateBookById(Book book) {
        return bookMapper.updateBookById(book);
    }

    @Override
    public Book queryBookById(String isbn) {
        return bookMapper.queryBookById(isbn);
    }

    @Override
    public List<Book> queryBookList() {
        return bookMapper.queryBookList();
    }

    @Override
    public List<Book> queryBookByIsbnOrBookName(Book book) {
        System.out.println("Service ==>" + book);
        return bookMapper.queryBookByIsbnOrBookName(book);
    }
}
